package cnpm.service.impl;

import java.util.List;

import cnpm.dao.EmployeeDAO;
import cnpm.dao.impl.EmployeeDAOImpl;
import cnpm.entity.Bank;
import cnpm.entity.Department;
import cnpm.entity.Employee;
import cnpm.entity.Office;
import cnpm.service.EmployeeService;

public class EmployeeServiceImpl implements EmployeeService{

	private EmployeeDAO empDAO;
	
	 public EmployeeServiceImpl() {
		 empDAO = new EmployeeDAOImpl();
	}
	 
	@Override
	public List<Employee> getAllEmployee() {
		return empDAO.getAllEmployee();
	}
	@Override
	public Employee getEmployeeByID(String empID) {
		return empDAO.getEmployeeByID(empID);
	}
	@Override
	public boolean saveOrUpdateEmployee(Employee e) {
		return empDAO.saveOrUpdateEmployee(e);
	}
	@Override
	public boolean deleteEmployee(Employee e) {
		return empDAO.deleteEmployee(e);
	}

	@Override
	public List<Employee> searchEmployee(String empFirstName,
			String empLastName, String empPhone, Office empOffice,
			String empEmail, Department empDept) {
		return empDAO.searchEmployee(empFirstName, empLastName, empPhone, empOffice, empEmail, empDept);
	}

	@Override
	public boolean isExitEmail(String email) {
		return empDAO.isExitEmail(email);
	}

	@Override
	public boolean isExitIndentityCard(String indentityCard) {
		return empDAO.isExitIndentityCard(indentityCard);
	}

	@Override
	public boolean isExitPhone(String phone) {
		return empDAO.isExitPhone(phone);
	}

	@Override
	public boolean isExitAccountBank(String accountBank, Bank bank) {
		return empDAO.isExitAccountBank(accountBank, bank);
	}

}
